{extend name="index/index"}
{block name="mycss"}
<link href="/static/index/css/pic.css" rel="stylesheet">
<link href="/static/index/css/pic1.css" rel="stylesheet">
<link href="/static/index/css/style.css" rel="stylesheet" type="text/css" media="all"/>
<style>
</style>
{/block}

{block name="fjs"}
<script type="text/javascript">
    var now = new Date();
    var beginTime = now.getTime();
    var b = 1;
    var stime = "1534990869";
    setInterval(function () {
        stime++;
    }, 1000);
</script>
{/block}
{block name="main"}
<div style="background-color: red;"></div>
{/block}
{block name="main1"}
<div class="box-topic" data-lkid="15">
    <div class="w1200">
        <div class="topic-wrap h-lg roll-box " id="NO08758">
            <div class="roll-wrap">
                <div class="clearfix" style="width: 1300px;">
                    <!--当前位置-->
                    <div class="bread-crumbs">
                        当前位置：
                        <span class="crumbs-handle">搜索:</span> &nbsp; &nbsp;<em class="text-orange">{$str}</em>
                        {empty name="data"}
                        关键字的搜索结果为0
                        {/empty}
                        <a href="{:url('index/index/index')}"><em class="text-orange">返回首页</em></a>

                    </div>
                    <!--END当前位置-->

                    <!--首页遍历-->
                    {volist name="data" id="v" key="k"}
                    <div class="qt-card-primary wrap-list roll-list fl">
                        <div class="card-img">
                            <a href="{:url('index/details/newpic',['id'=>$v['id']])}" target="_blank"
                               class="clickL" data-id="15-0-0">
                                <div class="card-trait">
                                    <div class="card-tag-business "></div>
                                </div>
                                <img class="" src="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}" alt="" width="268" height="356">
                                <div class="card-bg"></div>
                                <div class="card-handle">
                                    <div class="handle-dum qt-btn btn-green-linear download-page" data-id="32218731" data-yc="1" data-bg="0">
                                        <span cass="glyphicon glyphicon-download-alt">VIP免费下载</span>
                                    </div>
                                    <div class="handle-fav bottom-fav-ajax"  data-action="addFav" style="font-size:20px">
                                        <div class="" style="margin-top: -5px;margin-left: 5px">
                                            <span class="glyphicon glyphicon-heart house-btn" data-id="{$v['id']}"></span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="card-tag  isYC"></div>
                        <p class="card-title">{$v['desc']}</p><a href="http://www.58pic.com/newpic/32218731.html" class="card-title card-intro" target="_blank">
                        <span class="glyphicon glyphicon-download-alt ">下载数量:{$v['sold']}</span> &nbsp;&nbsp;
                        <span class="glyphicon glyphicon-gift">收藏数量:{$v['house']}</span>
                    </a>
                    </div>
                    {/volist}
                    <!--END图片遍历-->
                </div>
                {$page}

            </div>
        </div>
    </div>
</div>
{/block}
{block name="myjs"}
<script>
    $('.att-btn').click(function(){
        var fid=$(this).attr('data-id');
        attAjax(fid);
    })
    //执行关注和取消关注-->
    function attAjax(fid)
    {
        var fas = $('.fas-num').html();
        $.ajax({
            type:'post',
            dataType:'json',
            data:{'fid':fid},
            url:'/attention',
            success:function(data){
                if(data.status){
                    toastr.success('关注成功');
                    $('.att-btn').html('取消关注');
                    $('.fas-num').html(parseInt(fas)+1);
                }else{
                    toastr.success('取关成功');
                    $('.att-btn').html('点击关注');
                    $('.fas-num').html(parseInt(fas)-1);
                }
            },
            error:function(){
                toastr.error('网络错误,请重试');
            }
        })
    }
    $('.house-btn').click(function(){
        var gid =$(this).attr('data-id');
        houseAjax(gid);
        return false;
    })
    function houseAjax(gid)
    {
        $.ajax({
            type:'post',
            dataType:'json',
            data:{'gid':gid},
            url:'/house',
            success:function(data){
                if(data.status){
                    alert(data.info);
                }else{
                    alert(data.info);
                }
            },
            error:function(){
            }
        })
    }
</script>
{/block}